package org.darcy.youchat.activity.me.card;

import android.content.Intent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

import org.darcy.youchat.R;
import org.darcy.youchat.activity.BaseActivity;
import org.darcy.youchat.databinding.ActivityCardPacketBinding;

/**
 * me->卡包
 */
public class CardPaketActivity extends BaseActivity {

    private ActivityCardPacketBinding binding;

    @Override
    public void initView() {
        binding = ActivityCardPacketBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        setSupportActionBar(binding.mToolbar.toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        binding.mToolbar.toolbar.setNavigationIcon(R.mipmap.ic_back);
        getSupportActionBar().setTitle("卡包");
    }

    @Override
    public void initListener() {
        binding.cvVipCard.setOnClickListener(v -> startActivity(new Intent(this, VipCardActivity.class)));
        binding.cvFriendsCoupon.setOnClickListener(v -> startActivity(new Intent(this, FriendsCouponActivity.class)));
        binding.cvMyCoupon.setOnClickListener(v -> startActivity(new Intent(this, MyCouponActivity.class)));
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        new MenuInflater(this).inflate(R.menu.menu_one_text, menu);
        menu.getItem(0).setTitle("消息通知");
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                finish();
                break;
            case R.id.itemOne:
                startActivity(new Intent(this, MsgNotificationActivity.class));
                break;
        }
        return super.onOptionsItemSelected(item);
    }

}